<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/6 0006
 * Time: 17:11
 */
namespace app\modules\applets\models;

use yii\db\ActiveRecord;
use yii;

class AppletsCollect extends ActiveRecord
{
    public static function tableName()
    {
        return '{{%user_applets_collect}}';
    }

    /**
     * [isCollect description]
     * @Author don
     * @Date   2022-02-17
     * @param  [type]     $id  [description]
     * @param  [type]     $uid [description]
     * @return boolean         [description]
     */
    public static function isCollect($id, $uid, $type=1)
    {
        $res = self::find()->where(['uid'=>$uid, 'contentId'=>$id, 'type'=>$type])->one();

        return $res?1:0;
    }
}